package com.example.travelhelper.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.travelhelper.pojo.PageView;
import com.example.travelhelper.pojo.vo.LookMessage;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: zq
 * @Description: TODO
 * @Date: 2024/4/11 13:40
 * @Version: 1.8
 */
@Mapper
public interface PageViewMapper extends BaseMapper<PageView>{
    @Select("SELECT DATE(time) date , COUNT(*) count FROM page_view WHERE DATE(time) BETWEEN #{begin} AND #{end} GROUP BY DATE(time) order by date ")
    @Results({
            @Result(column = "date", property = "date"),
            @Result(column = "count", property = "count")
    })
    @ResultType(LookMessage.class)
    public List<LookMessage> getLookCount(@Param("begin") String begin,@Param("end") String end);
}
